** For "Who Holds Sovereign Debt and Why It Matters" by Fang, Hardy, and Lewis

// Advanced Economies
gen AE = 0

* List of Advanced Economy countries
local AECountries "Australia Austria Belgium Canada Denmark Finland France Germany Greece Hong Kong SAR Iceland Ireland Italy Japan Liechtenstein Luxembourg Macao SAR Malta Netherlands Zealand Norway Portugal Singapore Spain Sweden Switzerland Kingdom States"

foreach country in `AECountries' {
    replace AE = 1 if strmatch(Country, "*`country'*")
}

// Emerging Markets
gen EM = 0

* List of Emerging Market countries
local EMCountries "Argentina Bahrain Bangladesh Belarus Brazil Bulgaria Chile China Colombia Croatia Cyprus Czech Estonia Egypt Hungary India Indonesia Iran Israel Jordan Latvia Lithuania Kuwait Malaysia Mauritius Mexico Moldova Montenegro Morocco Nigeria Oman Pakistan Panama Peru Philippines Poland Qatar Romania Russia Saudi Slovak Slovenia Africa Korea Thailand Turkey Uruguay Ukraine Emirates Venezuela Vietnam"

foreach country in `EMCountries' {
    replace EM = 1 if strmatch(Country, "*`country'*")
}

// Developing Countries
gen DC = 1 - EM - AE
